<%@ Page Language="c#" Inherits="PHSRAG.Insight21.Admin.SponsorAddition" CodeFile="SponsorAddition.aspx.cs" %>

<%@ Register TagPrefix="cc1" Namespace="PHSRAG.Insight21.InsightWebControls" Assembly="PHSRAG.Insight21.InsightWebControls" %>
<%@ Register TagPrefix="cc2" Namespace="PHSRAG.WebControls" Assembly="PHSRAG.WebControls" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>SponsorAddition</title>
	<link href="../Insight21.css" type="text/css" rel="stylesheet" />

	<script type="text/javascript" language="javascript">	
		function ConfirmSubmit()
		{
			return confirm('Please validate that all fields are correct before submitting. Press \"OK\"  to continue, \"Cancel\" to go back.');
		}
	</script>

</head>
<body>
	<form id="sponsorAddition" method="post" runat="server">
		<table width="100%">
			<tr>
				<td>
					<table class="Header" width="100%">
						<tr>
							<td>
								<cc1:Header ID="header" runat="server" OnNavigate="OnHeaderNavigate" />
							</td>
						</tr>
						<tr>
							<td>
								<cc1:AdminSubNavigation ID="adminSubNavigation" runat="server" OnNavigate="OnSubNavigate" />
							</td>
						</tr>
						<tr>
							<td>
								<cc2:BreadCrumb ID="breadCrumb" runat="server"></cc2:BreadCrumb>
							</td>
						</tr>
					</table>
					<table class="Invisible" cellspacing="10" id="dynamicTable">
						<tr>
							<td>
								<cc2:ActivityIndicator ContainerID="dynamicTable" ID="activityIndicator" runat="server">
								</cc2:ActivityIndicator>
							</td>
						</tr>
						<tr>
							<td>
								<cc2:Annunciator ContainerID="dynamicTable" ID="annunciator" runat="server"></cc2:Annunciator>
							</td>
						</tr>
					</table>
					<table>
						<tr>
							<td>
								<label id="description" runat="server" class="Message" style="color: blue">
									<b>TO UPDATE SPONSOR:</b> To search for the sponsor you wish to update, enter a
									value in the Name or Short Name textboxes at the top of the page and hit Search.
									Clicking on the Name link will populate the sponsor information below. Make any
									necessary updates and then click the submit button.
									<br />
									<b>TO CREATE A NEW SPONSOR:</b> First verify that the sponsor is not in the system
									by searching for the sponsor using the Name or Short Name textboxes at the top.
									If the sponsor cannot be located, fill in the blank fields with the sponsor information
									you have and then click the submit button.</label></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<table width="100%">
			<tr>
				<td>
					<table>
						<tr>
							<td>
								<asp:Label ID="toSearch" runat="server"><b>Search for a sponsor here:</b></asp:Label></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="nameSearchLabel" runat="server">Name:</asp:Label></td>
							<td>
								<asp:TextBox ID="nameSearch" runat="server"></asp:TextBox></td>
							<td>
								<asp:Label ID="shortNameSearchLabel" runat="server">Short Name:</asp:Label></td>
							<td>
								<asp:TextBox ID="shortNameSearch" runat="server"></asp:TextBox></td>
							<td>
								<asp:ImageButton ID="search" runat="server" CausesValidation="False" ImageUrl="../Images/b_search_grey.gif"
									OnClick="OnSearchSponsors" /></td>
							<td>
								<asp:ImageButton ID="clear" runat="server" CausesValidation="False" ImageUrl="../Images/b_clearselect_grey.gif"
									OnClick="OnClearSponsors" /></td>
						</tr>
					</table>
					<hr />
					<table width="100%" cellspacing="0">
						<tr>
							<td>
								<cc2:Pager ID="pagerAboveDatagrid" runat="server" OnFirstPage="OnFirstPage" OnLastPage="OnLastPage"
									OnNextPage="OnNextPage" OnPreviousPage="OnPreviousPage" />
							</td>
						</tr>
						<tr>
							<td>
								<asp:DataGrid ID="dataGrid" runat="server" AllowCustomPaging="True" AllowPaging="True"
									AutoGenerateColumns="False" CssClass="DataGrid" OnItemCommand="OnItemCommand"
									ShowFooter="True" Width="100%">
									<PagerStyle Visible="False" />
									<HeaderStyle CssClass="DataGridHeader" />
									<AlternatingItemStyle CssClass="DataGridAlternatingItem" />
									<ItemStyle CssClass="DataGridItem" />
									<Columns>
										<asp:BoundColumn DataField="Id" ReadOnly="True" HeaderText="Sponsor ID" Visible="False">
										</asp:BoundColumn>
										<asp:ButtonColumn CommandName="SelectSponsorCommand" DataTextField="Name" HeaderText="Name">
										</asp:ButtonColumn>
										<asp:BoundColumn DataField="shortName" HeaderText="Short Name"></asp:BoundColumn>
										<asp:BoundColumn DataField="SponsorTypeName" HeaderText="Sponsor Type"></asp:BoundColumn>
										<asp:ButtonColumn CommandName="SelectMergeCommand" HeaderText="Merge From" Text="Merge">
										</asp:ButtonColumn>
									</Columns>
								</asp:DataGrid></td>
						</tr>
						<tr>
							<td>
								<cc2:Pager ID="pagerBelowDatagrid" runat="server" OnFirstPage="OnFirstPage" OnLastPage="OnLastPage"
									OnNextPage="OnNextPage" OnPreviousPage="OnPreviousPage" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<asp:Panel ID="mergePanel" Visible="False" runat="server">
				<tr>
					<td>
						&nbsp;</td>
				</tr>
				<tr>
					<td>
						<table width="100%">
							<tr style="width:100%">
								<td>
									<asp:Label ID="mergeLabel" runat="server"><b>Merge Candidate (This sponsor will be removed when submit is complete):</b></asp:Label>
									<asp:TextBox Width="100%" ID="mergeText" runat="server" ReadOnly="true" CssClass="WideTextBox"></asp:TextBox>
									<asp:TextBox ID="mergeId" runat="server" ReadOnly="true" Visible="false"></asp:TextBox>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</asp:Panel>
			<tr>
				<td>
					&nbsp;</td>
			</tr>
			<tr>
				<td>
					<table>
						<tr>
							<td>
								<asp:Label ID="toSubmit" runat="server"><b>Create/Update sponsor here:</b></asp:Label></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="nameLabel" runat="server">Name:</asp:Label></td>
							<td>
								<asp:TextBox ID="name" runat="server" CssClass="WideTextBox" MaxLength="150"></asp:TextBox></td>
							<td>
								<asp:RequiredFieldValidator ID="nameValidator" runat="server" ControlToValidate="name"
									ErrorMessage="Name is required"></asp:RequiredFieldValidator></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="shortNameLabel" runat="server">Short Name:</asp:Label></td>
							<td>
								<asp:TextBox ID="shortName" runat="server" CssClass="WideTextBox" MaxLength="100"></asp:TextBox></td>
							<td>
								<asp:RequiredFieldValidator ID="shortNameValidator" runat="server" ControlToValidate="shortName"
									ErrorMessage="Short Name is required"></asp:RequiredFieldValidator></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="typeLabel" runat="server">Sponsor Type:</asp:Label></td>
							<td>
								<asp:DropDownList ID="sponsorType" runat="server">
								</asp:DropDownList></td>
							<td>
								<asp:CustomValidator ID="sponsorTypeValidator" runat="server" ControlToValidate="sponsorType"
									ErrorMessage="Select a Sponsor Type" OnServerValidate="OnSponsorTypeValidate"></asp:CustomValidator></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="PSAcctLabel" runat="server">Peoplesoft Account #:</asp:Label></td>
							<td>
								<asp:TextBox ID="PSAcct" runat="server" CssClass="WideTextBox"></asp:TextBox><br />
							</td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="streetLabel" runat="server">Address:</asp:Label></td>
							<td>
								<asp:TextBox ID="street" runat="server" CssClass="WideTextBox"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="street2Label" runat="server">Address 2:</asp:Label></td>
							<td>
								<asp:TextBox ID="street2" runat="server" CssClass="WideTextBox"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="cityLabel" runat="server">City:</asp:Label></td>
							<td>
								<asp:TextBox ID="city" runat="server" CssClass="WideTextBox" MaxLength="35"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="stateLabel" runat="server">State:</asp:Label></td>
							<td>
								<asp:TextBox ID="state" runat="server" CssClass="WideTextBox" MaxLength="3"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="countryLabel" runat="server">Country:</asp:Label></td>
							<td>
								<asp:DropDownList ID="country" runat="server">
								</asp:DropDownList></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="zipCodeLabel" runat="server">Zip Code:</asp:Label></td>
							<td>
								<asp:TextBox ID="zipCode" runat="server" CssClass="WideTextBox" MaxLength="10"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="emailLabel" runat="server">Sponsor Email:</asp:Label></td>
							<td>
								<asp:TextBox ID="email" runat="server" CssClass="WideTextBox" MaxLength="80"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="icrRateLabel" runat="server">Indirect Cost Rate/Base:</asp:Label></td>
							<td>
								<asp:TextBox ID="icRate" runat="server" CssClass="WideTextBox"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="commentsLabel" runat="server">Comments/Description:</asp:Label></td>
							<td>
								<asp:TextBox ID="comments" runat="server" TextMode="MultiLine"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="infoEdSponCodeLabel" runat="server">InfoEd Spon Code:</asp:Label></td>
							<td>
								<asp:TextBox ID="infoEdSponCode" runat="server" CssClass="WideTextBox" MaxLength="30"
									ReadOnly="true"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:Label ID="rexIdLabel" runat="server">ReX Id:</asp:Label></td>
							<td>
								<asp:TextBox ID="rexId" runat="server" CssClass="WideTextBox" MaxLength="30" ReadOnly="true"></asp:TextBox></td>
						</tr>
						<tr>
							<td>
								<asp:ImageButton ID="submit" runat="server" CausesValidation="True" ImageUrl="../Images/b_submit.gif"
									OnClick="OnSubmitSponsor" OnClientClick="return ConfirmSubmit();" /></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
